<!--
 * @Author: Dorange.Wang
 * @Date: 2021-07-07 15:36:52
 * @LastEditors: your name
 * @LastEditTime: 2021-07-09 14:04:24
 * @Description: file content
-->
<template>
  <div>
    <div v-for="menu in userMenuTree" :key="menu.id">
      <div class="title">{{menu.name}}</div>
      <van-grid>
        <van-grid-item 
          v-for="sub in menu.children"
          icon="photo-o" 
          :key="sub.id"
          :text="sub.name"
          @click="handlePageClick(sub)"
        />
      </van-grid>
    </div>
  </div>
</template>

<script>
import {mapGetters} from 'vuex'
export default {
  computed:{
    ...mapGetters(['userMenuTree'])
  },

  created(){
  },

  methods:{
    handlePageClick(sub){
      console.log(sub)
      this.$router.push({
        path: `/universal/${sub.pageId}`
      })
    }
  }
}
</script>

<style lang="less" scoped>
.title{
  font-size: 12px;
}
</style>